﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication3.权限管理
{
    public partial class add_info : Form
    {
        权限管理.addStudents myAddStudents = new 权限管理.addStudents();
        权限管理.addTeachers myAddTeachers = new 权限管理.addTeachers();
        public add_info()
        {
            InitializeComponent();
            panel1.Top = button_addStu.Top + button_addStu.Height;
            panel1.Left = 0;
            panel1.Width = this.Width;
            panel1.Height = this.Height - panel1.Top;

            init_form(myAddStudents);
            init_form(myAddTeachers);
        }
        private void init_form(Form myform)
        {
            myform.TopLevel = false;
        }

        private void Show_form(Form myform)
        {
            panel1.Controls.Clear();
            panel1.Controls.Add(myform);
            myform.Top = 0;
            myform.Width = panel1.Width;
            myform.Height = panel1.Height;
            myform.Show();
        }

        private void button_addStu_Click(object sender, EventArgs e)
        {
            Show_form(myAddStudents);
        }

        private void button_addTeac_Click(object sender, EventArgs e)
        {
            Show_form(myAddTeachers);
        }
    }
}
